import wdconfig
Import('RTT_ROOT')
from building import *

# get current directory
cwd = GetCurrentDir()

# The set of source files associated with this SConscript file.
src = Split("""
stm32f4xx_adc.c
stm32f4xx_dcmi.c
stm32f4xx_dma.c
stm32f4xx_exti.c
stm32f4xx_flash.c
stm32f4xx_fsmc.c
stm32f4xx_gpio.c
stm32f4xx_pwr.c
stm32f4xx_rcc.c
stm32f4xx_rtc.c
stm32f4xx_sdio.c
stm32f4xx_spi.c
stm32f4xx_usart.c
stm32f4xx_syscfg.c
misc.c
""")

# starupt scripts for each STM32 kind

src = src + ['CORE/' + 'startup_stm32f40_41xxx.s']

path = [cwd,
cwd + '/CORE']


CPPDEFINES = ['USE_STDPERIPH_DRIVER', wdconfig.STM32_TYPE]
group = DefineGroup('stm32lib', src, depend = [''], CPPPATH = path, CPPDEFINES = CPPDEFINES)

Return('group')
